package com.service.impl;

import com.mapper.GroupAllMapper;
import com.mapper.ResAllMapper;

import com.model.GroupAll;
import com.model.ResAll;

import com.model.ResAllExample;
import com.service.RestaurantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Hu on 2017/3/25.
 */
@Service
@Transactional
public class RestaurantServiceImpl implements RestaurantService {
    @Autowired
    GroupAllMapper groupAllMapper;
    @Autowired
    ResAllMapper resAllMapper;

    public int insert(GroupAll groupAll) {
        return groupAllMapper.insert(groupAll);
    }

    public int insert(ResAll resAll) {
        return resAllMapper.insert(resAll);
    }

    public List<ResAll> selectByExample(ResAllExample resAllExample) {
        return resAllMapper.selectByExample(resAllExample);
    }

    public ResAll getRestById(Integer id) {
        return resAllMapper.selectByPrimaryKey(id);
    }

    public int updateRes(ResAll resAll) {
        return resAllMapper.updateByPrimaryKeySelective(resAll);
    }

    public int delResById(Integer id) {
        return resAllMapper.deleteByPrimaryKey(id);
    }
}
